From bda2d64b0bb549b78e5fe8f0b2b1844f26135828 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Thu, 28 Apr 2005 15:11:15 +0000 Subject: [PATCH] bitkeeper revision 1.1385.2.1 (4270fd13Fv84etl6vfPTPXdxld-15A) page.h: Revert change to pgd_val to always set the PAGE_PRESENT bit. fixup.c: Cleanup whitespace. setup.c: Whitespace cleanup. Whitespace cleanups. process.c: Whitespace. pci-dma.c: revert part of previous for sync w/ 2.0. g/c unused code and cleanup whitespace. head.S: Break __xen_guest definition up in several lines. common.c: whitespace cleanup. --- .../arch/xen/i386/kernel/cpu/common.c | 2 +- .../arch/xen/i386/kernel/head.S | 4 +- .../arch/xen/i386/kernel/pci-dma.c | 42 +++++++------------ .../arch/xen/i386/kernel/process.c | 4 +- .../arch/xen/i386/kernel/setup.c | 32 +++++++------- .../arch/xen/kernel/fixup.c | 7 ++-- .../include/asm-xen/asm-i386/page.h | 2 +- 7 files changed, 40 insertions(+), 53 deletions(-) diff --git a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c index 3dc5ed10a6..c608ef099a 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c @@ -600,7 +600,7 @@ void __init cpu_init (void) * Set up the per-thread TLS descriptor cache: */ memcpy(thread->tls_array, &get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN], - GDT_ENTRY_TLS_ENTRIES * 8); + GDT_ENTRY_TLS_ENTRIES * 8); cpu_gdt_init(&cpu_gdt_descr[cpu]); diff --git a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S index 04afb41017..91036572bc 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S @@ -2,7 +2,9 @@ #include .section __xen_guest - .ascii "GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=3.0,VIRT_BASE=0xC0000000" + .ascii "GUEST_OS=linux,GUEST_VER=2.6" + .ascii ",XEN_VER=3.0" + .ascii ",VIRT_BASE=0xC0000000" .ascii ",LOADER=generic" .byte 0 diff --git a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c index b4696e4e4c..0716f0c62b 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c @@ -44,13 +44,13 @@ xen_contig_memory(unsigned long vstart, unsigned int order) /* 1. Zap current PTEs, giving away the underlying pages. */ for (i = 0; i < (1<pte_low >> PAGE_SHIFT; - HYPERVISOR_update_va_mapping( - vstart + (i*PAGE_SIZE), __pte_ma(0), 0); + pgd = pgd_offset_k(vstart + (i*PAGE_SIZE)); + pud = pud_offset(pgd, vstart + (i*PAGE_SIZE)); + pmd = pmd_offset(pud, vstart + (i*PAGE_SIZE)); + pte = pte_offset_kernel(pmd, vstart + (i*PAGE_SIZE)); + pfn = pte_val_ma(*pte) >> PAGE_SHIFT; + HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE), + __pte_ma(0), 0); phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = INVALID_P2M_ENTRY; if (HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, @@ -61,17 +61,10 @@ xen_contig_memory(unsigned long vstart, unsigned int order) &pfn, 1, order) != 1) BUG(); /* 3. Map the new extent in place of old pages. */ for (i = 0; i < (1<>PAGE_SHIFT)+i); - phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = - pfn+i; + xen_machphys_update(pfn+i, (__pa(vstart)>>PAGE_SHIFT)+i); + phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = pfn+i; } flush_tlb_all(); @@ -82,11 +75,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, int gfp) { void *ret; + struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; unsigned int order = get_order(size); unsigned long vstart; - - struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; - /* ignore region specifiers */ gfp &= ~(__GFP_DMA | __GFP_HIGHMEM); @@ -108,14 +99,13 @@ void *dma_alloc_coherent(struct device *dev, size_t size, vstart = __get_free_pages(gfp, order); ret = (void *)vstart; - if (ret == NULL) - return ret; - - xen_contig_memory(vstart, order); - memset(ret, 0, size); - *dma_handle = virt_to_bus(ret); + if (ret != NULL) { + xen_contig_memory(vstart, order); + memset(ret, 0, size); + *dma_handle = virt_to_bus(ret); + } return ret; } diff --git a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c index 771208d00c..0f9a2eed70 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c @@ -329,7 +329,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, desc->b = LDT_entry_b(&info); } - p->thread.io_pl = current->thread.io_pl; + p->thread.io_pl = current->thread.io_pl; err = 0; out: @@ -445,7 +445,7 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas physdev_op_t iopl_op, iobmp_op; multicall_entry_t _mcl[8], *mcl = _mcl; - /* XEN NOTE: FS/GS saved in switch_mm(), not here. */ + /* XEN NOTE: FS/GS saved in switch_mm(), not here. */ /* * This is basically '__unlazy_fpu', except that we queue a diff --git a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c index 5723ed21c4..2d385c1c09 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include